<h1 class="header">
        <?php echo __('Programs');?>
</h1>

<table class="teachers_table" cellspacing="0" cellpadding="0">
    <thead>
        <tr>
            <th><?php echo __('No.')?></th>
            <th><?php echo __('Program name')?></th>
            <th><?php echo __('Location')?></th>
            <th><?php echo __('Training start date')?></th>
            <th><?php echo __('Training end date')?></th>            
            <th></th>              
        </tr>
    </thead>
    <tbody>
        <?php if(!count($programs)){?>
        <tr>
            <td colspan="5" class="no_data">
                <?php echo __('No programs found')?>
            </td>
        </tr>
        <?php 
        }else{
        $i = 0;
        foreach($programs as $program){?>
        <tr class="<?php echo $i%2==1?'odd':'even'?>">
            <td><?php echo ++$i ?></td>
            <td>
                <?php echo $program?>
                <br/>
                 [<a class="card_link" href="#" onclick="window.open('<?php echo url_for('program/card?id='.$program['id'])?>', 'programWindow', 'width=600,height=600,scrollbars=true')"><?php echo __('Program card')?></a>]                
            </td>
            <td><?php echo  $program->getLocationsInSector()->getExtendedString();?></td>
            <td><?php echo  $program->getStartDate();?></td>
            <td><?php echo  $program->getEndDate();?></td>            
            <td>
                <a onclick="return popup('List Teachers',this.href,600,800)" href="<?php echo url_for('program/listTeachers?id='.$program->getId()) ?>"><?php echo __('List Instructors')?></a>           
                <br/>
                <a href="<?php echo url_for('program/exportAttendance?id='.$program->getId()) ?>"><?php echo __('Export Attendance List')?></a>          
                <br/>
                <a onclick="return popup('Fill Attendance',this.href,1000,700)" href="<?php echo url_for('program/fillAttendance?id='.$program->getId()) ?>"><?php echo __('Fill Attendance')?></a>
            </td>            
        </tr>
        <?php }
        }?>
    </tbody>
</table>    